package com.group2.view;

import java.awt.EventQueue;

import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

import model.Book;

import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JPanel;
import javax.swing.border.TitledBorder;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.JFrame;

import java.awt.event.*;
import javax.swing.ImageIcon;
import java.awt.Font;
import java.io.*;
import java.net.Socket;
import java.util.ArrayList;
import java.util.Vector;
import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;
import model.*;
import static model.netBase.IP;

public class LibraryMainFrame_Admin extends JFrame {
	private JTable booktable;
	private JTextField BookIdText;
	private JTextField BookNameText;
	private JTextField BookTypeText;
	private JTextField BookAuthorText;
	private JTextField BookPublisherText;
	private JTextField BookIdSearch;
	private JTextField BookNameSearch;
	private JTextField AuthorSearch;
	private JComboBox BookTypeSearch = new JComboBox();
	private static ArrayList<Book>list=null;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					LibraryMainFrame_Admin frame = new LibraryMainFrame_Admin();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public LibraryMainFrame_Admin() throws IOException, ClassNotFoundException {
		getContentPane().setFont(new Font("黑体", Font.PLAIN, 15));
		setFont(new Font("黑体", Font.PLAIN, 15));
		setTitle("图书维护");
		setBounds(100, 100, 516, 624);
		this.setLocationRelativeTo(null);
		this.setResizable(false);
		JScrollPane scrollPane = new JScrollPane();
		
		JPanel panel = new JPanel();
		panel.setBorder(new TitledBorder(null, "\u67E5\u8BE2\u6761\u4EF6", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		
		JPanel panel_1 = new JPanel();
		panel_1.setBorder(new TitledBorder(null, "\u4FE1\u606F\u4FEE\u6539", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		
		JButton btnNewButton_2 = new JButton("修改");
		btnNewButton_2.setIcon(new ImageIcon(LibraryMainFrame_Admin.class.getResource("/images/modify.png")));
		btnNewButton_2.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				try {
					bookUpdateActionPerformed(evt);
				} catch (IOException | ClassNotFoundException e) {
					throw new RuntimeException(e);
				}
			}

			
		});
		
		JButton btnNewButton_3 = new JButton("删除");
		btnNewButton_3.setIcon(new ImageIcon(LibraryMainFrame_Admin.class.getResource("/images/delete.png")));
		btnNewButton_3.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				try {
					bookDeleteActionPerformed(evt);
				} catch (IOException e) {
					throw new RuntimeException(e);
				} catch (ClassNotFoundException e) {
					throw new RuntimeException(e);
				}
			}

		});
		
		JButton btnNewButton_4 = new JButton("添加");
		btnNewButton_4.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				LibraryAddBookFrame libraryAddBookFrame=new LibraryAddBookFrame();
				libraryAddBookFrame.setVisible(true);
				libraryAddBookFrame.addWindowListener(new WindowListener() {
					@Override
					public void windowOpened(WindowEvent e) {

					}

					@Override
					public void windowClosing(WindowEvent e) {

					}

					@Override
					public void windowClosed(WindowEvent e) {
						try {
							refresh();
						} catch (IOException ex) {
							throw new RuntimeException(ex);
						} catch (ClassNotFoundException ex) {
							throw new RuntimeException(ex);
						}
						fillbooktable(list);
					}

					@Override
					public void windowIconified(WindowEvent e) {

					}

					@Override
					public void windowDeiconified(WindowEvent e) {

					}

					@Override
					public void windowActivated(WindowEvent e) {

					}

					@Override
					public void windowDeactivated(WindowEvent e) {

					}
				});
			}
		});
		btnNewButton_4.setIcon(new ImageIcon(LibraryMainFrame_Admin.class.getResource("/images/add.png")));
		GroupLayout groupLayout = new GroupLayout(getContentPane());
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(118)
					.addComponent(btnNewButton_2)
					.addGap(18)
					.addComponent(btnNewButton_3)
					.addGap(18)
					.addComponent(btnNewButton_4)
					.addContainerGap(117, Short.MAX_VALUE))
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(43)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(panel, GroupLayout.PREFERRED_SIZE, 410, GroupLayout.PREFERRED_SIZE)
							.addContainerGap())
						.addGroup(groupLayout.createSequentialGroup()
							.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
								.addComponent(panel_1, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 412, Short.MAX_VALUE)
								.addComponent(scrollPane, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 412, Short.MAX_VALUE))
							.addGap(47))))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(12)
					.addComponent(panel, GroupLayout.PREFERRED_SIZE, 153, GroupLayout.PREFERRED_SIZE)
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, 128, GroupLayout.PREFERRED_SIZE)
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addComponent(panel_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(btnNewButton_2)
						.addComponent(btnNewButton_3)
						.addComponent(btnNewButton_4))
					.addGap(15))
		);
		
		JLabel lblNewLabel_4 = new JLabel("图书编号：");
		
		BookIdText = new JTextField();
		BookIdText.setColumns(10);
		
		JLabel lblNewLabel_5 = new JLabel("图书名称：");
		
		BookNameText = new JTextField();
		BookNameText.setColumns(10);
		
		JLabel lblNewLabel_6 = new JLabel("图书类别：");
		
		BookTypeText = new JTextField();
		BookTypeText.setColumns(10);
		
		JLabel lblNewLabel_7 = new JLabel("作者：");
		
		BookAuthorText = new JTextField();
		BookAuthorText.setColumns(10);
		
		BookPublisherText = new JTextField();
		BookPublisherText.setColumns(10);
		
		JLabel lblNewLabel_8 = new JLabel("出版社：");
		GroupLayout gl_panel_1 = new GroupLayout(panel_1);
		gl_panel_1.setHorizontalGroup(
			gl_panel_1.createParallelGroup(Alignment.TRAILING)
				.addGroup(gl_panel_1.createSequentialGroup()
					.addContainerGap(121, Short.MAX_VALUE)
					.addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING, false)
						.addGroup(gl_panel_1.createSequentialGroup()
							.addComponent(lblNewLabel_5)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(BookNameText))
						.addGroup(gl_panel_1.createSequentialGroup()
							.addComponent(lblNewLabel_4)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(BookIdText))
						.addGroup(gl_panel_1.createSequentialGroup()
							.addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)
								.addComponent(lblNewLabel_6)
								.addComponent(lblNewLabel_7)
								.addComponent(lblNewLabel_8))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(gl_panel_1.createParallelGroup(Alignment.TRAILING)
								.addComponent(BookAuthorText, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 104, Short.MAX_VALUE)
								.addComponent(BookTypeText, Alignment.LEADING)
								.addComponent(BookPublisherText, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 104, Short.MAX_VALUE))))
					.addGap(111))
		);
		gl_panel_1.setVerticalGroup(
			gl_panel_1.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panel_1.createSequentialGroup()
					.addContainerGap()
					.addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblNewLabel_4)
						.addComponent(BookIdText, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblNewLabel_5)
						.addComponent(BookNameText, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblNewLabel_6)
						.addComponent(BookTypeText, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblNewLabel_7)
						.addComponent(BookAuthorText, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
						.addComponent(BookPublisherText, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblNewLabel_8))
					.addContainerGap(29, Short.MAX_VALUE))
		);
		panel_1.setLayout(gl_panel_1);
		
		JLabel lblNewLabel = new JLabel("图书编号：");
		
		BookIdSearch = new JTextField();
		BookIdSearch.setColumns(10);
		
		JLabel lblNewLabel_1 = new JLabel("图书类别：");

		BookTypeSearch.setToolTipText("请选择");
		BookTypeSearch.setModel(new DefaultComboBoxModel(new String[] {"所有", "哲学", "社会科学", "政治", "军事", "经济", "文化", "文学", "艺术", "历史地理", "自然科学", "数理科学", "天文", "生物科学", "医学卫生", "农业科学", "工业技术", "交通运输", "航空航天", "环境科学", "综合性图书", "其他"}));
		
		JLabel lblNewLabel_2 = new JLabel("图书名称：");
		
		JLabel lblNewLabel_3 = new JLabel("作者：");
		
		JButton btnNewButton = new JButton("查询");
		btnNewButton.setIcon(new ImageIcon(LibraryMainFrame_Admin.class.getResource("/images/search.png")));
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				try {
					booksearchActionPerformed(e);
				} catch (IOException | ClassNotFoundException ex) {
					throw new RuntimeException(ex);
				}
			}

			
		});
		
		JButton btnNewButton_1 = new JButton("取消");
		btnNewButton_1.setIcon(new ImageIcon(LibraryMainFrame_Admin.class.getResource("/images/reset.png")));
		btnNewButton_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				resetValueActionPerformed(evt);
			}
		});
		
		BookNameSearch = new JTextField();
		BookNameSearch.setColumns(10);
		
		AuthorSearch = new JTextField();
		AuthorSearch.setColumns(10);
		GroupLayout gl_panel = new GroupLayout(panel);
		gl_panel.setHorizontalGroup(
			gl_panel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panel.createSequentialGroup()
					.addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_panel.createSequentialGroup()
							.addGap(122)
							.addComponent(btnNewButton)
							.addGap(18)
							.addComponent(btnNewButton_1))
						.addGroup(gl_panel.createSequentialGroup()
							.addContainerGap()
							.addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
								.addGroup(gl_panel.createSequentialGroup()
									.addComponent(lblNewLabel_1)
									.addPreferredGap(ComponentPlacement.RELATED)
									.addComponent(BookTypeSearch, GroupLayout.PREFERRED_SIZE, 91, GroupLayout.PREFERRED_SIZE))
								.addGroup(gl_panel.createSequentialGroup()
									.addComponent(lblNewLabel)
									.addPreferredGap(ComponentPlacement.RELATED)
									.addComponent(BookIdSearch, GroupLayout.PREFERRED_SIZE, 91, GroupLayout.PREFERRED_SIZE)))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
								.addComponent(lblNewLabel_2)
								.addComponent(lblNewLabel_3))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
								.addComponent(AuthorSearch, GroupLayout.DEFAULT_SIZE, 155, Short.MAX_VALUE)
								.addComponent(BookNameSearch, GroupLayout.DEFAULT_SIZE, 155, Short.MAX_VALUE))))
					.addContainerGap())
		);
		gl_panel.setVerticalGroup(
			gl_panel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panel.createSequentialGroup()
					.addContainerGap()
					.addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_panel.createSequentialGroup()
							.addGroup(gl_panel.createParallelGroup(Alignment.BASELINE)
								.addComponent(lblNewLabel)
								.addComponent(BookIdSearch, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addGroup(gl_panel.createParallelGroup(Alignment.BASELINE)
								.addComponent(lblNewLabel_1)
								.addComponent(BookTypeSearch, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
						.addGroup(gl_panel.createSequentialGroup()
							.addGroup(gl_panel.createParallelGroup(Alignment.BASELINE)
								.addComponent(lblNewLabel_2)
								.addComponent(BookNameSearch, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addGroup(gl_panel.createParallelGroup(Alignment.BASELINE)
								.addComponent(lblNewLabel_3)
								.addComponent(AuthorSearch, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))))
					.addGap(18)
					.addGroup(gl_panel.createParallelGroup(Alignment.BASELINE)
						.addComponent(btnNewButton)
						.addComponent(btnNewButton_1))
					.addContainerGap(36, Short.MAX_VALUE))
		);
		panel.setLayout(gl_panel);
		
		booktable = new JTable();
		booktable.addMouseListener(new MouseAdapter() {
			@Override
			public void mousePressed(MouseEvent met) {
				booktableMousePressed(met);
			}

			
		});
		scrollPane.setViewportView(booktable);
		booktable.setModel(new DefaultTableModel(
			new Object[][] {
			},
			new String[] {
				"\u56FE\u4E66\u7F16\u53F7", "\u56FE\u4E66\u540D\u79F0", "\u56FE\u4E66\u7C7B\u522B", "\u4F5C\u8005", "\u51FA\u7248\u793E"
			}
		));
		getContentPane().setLayout(groupLayout);
		refresh();
		this.fillbooktable(list);
		
	}
	public void refresh() throws IOException, ClassNotFoundException {
		Socket socket = new Socket(IP(), 2000);//此处主机地址请自行修改
		//设置超时时间
		socket.setSoTimeout(3000);
		//构建IO
		OutputStream os = socket.getOutputStream();
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(os));
		bw.write("21"+'\n');
		bw.flush();
		//从服务端输入到本地
		System.out.println("开始传输");
		InputStream is = socket.getInputStream();
		ObjectInputStream in = new ObjectInputStream(is);
		Object obj = in.readObject();
		list = (ArrayList<Book>) obj;
		//输出输入流关闭
		is.close();
		os.close();
		socket.close();
		System.out.println("传输结束");
	}
	/**
	 * 初始化表格数据
	 */
	private void fillbooktable(ArrayList<Book> course) {
		DefaultTableModel dtm=(DefaultTableModel) booktable.getModel();
		dtm.setRowCount(0);//设为0行
		//连接数据库
		try {
			int size = course.size();
			int index = 0;
			while (size > 0) {
				Vector v = new Vector();
				v.add(course.get(index).getBookId());v.add(course.get(index).getBookName()) ;v.add(course.get(index).getBookType());v.add(course.get(index).getBookAuthor());v.add(course.get(index).getBookPublisher());if(course.get(index).getBookAvailability().equals("0"))v.add("已借阅");
				dtm.addRow(v);
				size--;
				index++;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	/**
	 * 图书查询事件处理
	 * @param
	 */
	private void booksearchActionPerformed(ActionEvent evt) throws IOException, ClassNotFoundException {
		String bookID=this.BookIdSearch.getText();
		String bookName=this.BookNameSearch.getText();
		String bookAuthor=this.AuthorSearch.getText();
		String bookType=BookTypeSearch.getSelectedItem().toString();
		//连接数据库
		Socket socket = new Socket(IP(), 2000);//此处主机地址请自行修改
		//设置超时时间
		socket.setSoTimeout(3000);
		//构建IO
		System.out.println("开始传输");
		OutputStream os = socket.getOutputStream();
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(os));
		System.out.println(bookName+" "+bookType+" "+bookAuthor+" ");
		bw.write("22"+'\n'+bookID+'\n'+bookName+'\n'+bookType+'\n'+bookAuthor+'\n');
		bw.flush();
		//从服务端输入到本地
		InputStream is = socket.getInputStream();
		ObjectInputStream in = new ObjectInputStream(is);
		Object obj = in.readObject();
		list = (ArrayList<model.Book>) obj;
		System.out.println(list);
		//输出输入流关闭
		is.close();
		os.close();
		socket.close();
		System.out.println("传输结束");
		fillbooktable(list);
		
	}
	/**
	 * 表格行点击事件处理
	 * @param met
	 */
	private void booktableMousePressed(MouseEvent met) {
		int row=this.booktable.getSelectedRow();
		this.BookIdText.setText(String.valueOf(booktable.getValueAt(row, 0)));
		this.BookNameText.setText((String.valueOf(booktable.getValueAt(row, 1))));
		this.BookTypeText.setText((String.valueOf(booktable.getValueAt(row, 2))));
		this.BookAuthorText.setText((String.valueOf(booktable.getValueAt(row, 3))));
		this.BookPublisherText.setText((String.valueOf(booktable.getValueAt(row, 4))));
	}
	/**
	 * 图书修改事件处理
	 */
	private void bookUpdateActionPerformed(ActionEvent evt) throws IOException, ClassNotFoundException {
		String bookID=this.BookIdText.getText();
		String bookName=this.BookNameText.getText();
		String bookType=this.BookTypeText.getText();
		String bookAuthor=this.BookAuthorText.getText();
		String bookPublisher=this.BookPublisherText.getText();
		
		if(bookID=="")
		{
			JOptionPane.showMessageDialog(null,"请选择要修改的记录");
			return;
		}
		if(bookName=="")
		{
			JOptionPane.showMessageDialog(null,"图书名称不能为空");
			return;
		}
		if(bookType=="")
		{
			JOptionPane.showMessageDialog(null,"图书类型不能为空");
			return;
		}
		if(bookAuthor=="")
		{
			JOptionPane.showMessageDialog(null,"作者不能为空");
			return;
		}
		if(bookPublisher=="")
		{
			JOptionPane.showMessageDialog(null,"出版社不能为空");
			return;
		}
		
		Book book=new Book();
		book.setBookName(bookName);
		book.setBookType(bookType);
		book.setBookAuthor(bookAuthor);
		book.setBookPublisher(bookPublisher);
		//连接数据库
		Socket socket = new Socket(IP(), 2000);//此处主机地址请自行修改
		//设置超时时间
		socket.setSoTimeout(3000);
		//构建IO
		OutputStream os = socket.getOutputStream();
		InputStream is = socket.getInputStream();
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(os));
		BufferedReader br = new BufferedReader(new InputStreamReader(is));
		//传输请求业务
		bw.write("27" + '\n'+bookID+'\n'+bookName+'\n'+bookAuthor+'\n'+bookPublisher+'\n'+bookType+'\n');
		bw.flush();
		//从服务端输入到本地
		String str= br.readLine();
		System.out.println(str);
		System.out.println("传输结束");
		//输出输入流关闭
		os.close();
		socket.close();
		if (str.equals("true")) {
			JOptionPane.showMessageDialog(this, "修改成功!");
			refresh();
			fillbooktable(list);
		} else {
			JOptionPane.showMessageDialog(this, "修改失败!");
		}
	}
	/**
	 * 图书删除事件处理
	 * @param evt
	 */
	private void bookDeleteActionPerformed(ActionEvent evt) throws IOException, ClassNotFoundException {
		String bookID=this.BookIdText.getText();
		if(bookID=="")
		{
			JOptionPane.showMessageDialog(null,"请选择要删除的记录");
			return;
		}
		int n=JOptionPane.showConfirmDialog(null, "确定要删除记录吗？");
				if(n==0) {
					//连接数据库
					//连接数据库
					Socket socket = new Socket(IP(), 2000);//此处主机地址请自行修改
					//设置超时时间
					socket.setSoTimeout(3000);
					//构建IO
					OutputStream os = socket.getOutputStream();
					InputStream is = socket.getInputStream();
					BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(os));
					BufferedReader br = new BufferedReader(new InputStreamReader(is));
					//传输请求业务
					bw.write("28" + '\n'+bookID+'\n');
					bw.flush();
					//从服务端输入到本地
					String str= br.readLine();
					System.out.println(str);
					System.out.println("传输结束");
					//输出输入流关闭
					os.close();
					socket.close();
					if (str.equals("true")) {
						JOptionPane.showMessageDialog(this, "删除成功!");
						refresh();
						fillbooktable(list);
					} else {
						JOptionPane.showMessageDialog(this, "删除失败!");
					}
				}
	}
	/**
	 * 重置事件处理
	 * @param evt
	 */
	private void resetValueActionPerformed(ActionEvent evt) {
		this.resetValue();
	}
	/**
	 * 清空内容（重置）
	 */
	private void resetValue() {
		this.BookIdSearch.setText("");
		this.BookNameSearch.setText("");
		this.AuthorSearch.setText("");
	}
}
